package tech.aistar.day07.interfaces.biaoji;

/**
 * 本类用来演示:
 *
 * @author: success
 * @date: 2021/3/16 3:06 下午
 */
public class TestSpeed {
    public static void main(String[] args) {
        //需要对car进行酒驾检测
        Vehicle car = new Car();
        //假设飞行员不需要酒驾检测
        Vehicle plane = new Plane();

        Vehicle[] vehicles = new Vehicle[2];
        vehicles[0] = car;
        vehicles[1] = plane;

        for (Vehicle vehicle : vehicles) {
            if(vehicle instanceof ICheckSpeed){
                System.out.println("car 需要进行检测");
            }else{
                System.out.println("plane直接通过");
            }
        }
    }
}
